package com.aswin.test.scala.basic

/** 
 * User: aswin
 */

object Extractors extends Application {

  val a = "aswin.nair@gmail.com"

  val Email(name, domain) = a

  println (name)

  println (domain)

}


object Email{

  def unapply(a:String):Option[(String, String)] = {
      var b = a.split("@")
      if (b.length == 1) None else Some(b(0), b(1))
  }

}